07. Example: Jane's Store

Connections, Sessions, and Transactions in TCP/IP Heading

Client-Server Model Example: Jane's Store

In this next series of videos, we'll walk through how client-server interactions would occur in an example of an online store. We'll see how traffic gets routed from a web client, to a web server, to a database, and eventually back to a web client.

ND004 C01 L02 07 Example 1- Online Store

Takeaways

  • Clicking on the Polo product leads to a click event being registered by the browser, on the client computer.
  • A click handler in the view would send a request to the server (in Javascript) from the client browser.
  • A client could request more data and a different view to be rendered (with that data).
  • A server process listens to the request sent from the view. It fetches the data and chooses what to render next, using the fetched data.

ND004 C01 L02 08 Example 1- Recap-Summary

Takeaways

  • The client sends a request to the server, including information about the request type and any user input data.
  • The server receives the request, and uses the user input data to determine how to shape its request to the database, and sends a request to the database.
  • The database processes this request, and sends a response back to the web server.
  • The server receives the response from the database, and uses it to determine the view + powers the view template with the fetched data, sending it back to the client's browser.
  • The client is responsible for rendering something to the user, that represents both the data and its representation.

Client-Server

QUIZ QUESTION: :

Match each party and its responsibility

ANSWER CHOICES:



Responsibility

Party

Database

Web Server

Client

SOLUTION:

Responsibility

Party

Database

Web Server

Client

Client-Server-Database Flow

QUIZ QUESTION: :

In the left-hand column below, you'll find a sentence that describes what we just learned. See if you can fill in all the blanks to complete the sentence.

ANSWER CHOICES:



Sentence

Fill in the blank

web server

client

database

web server

client

SOLUTION:

Sentence

Fill in the blank

web server

web server

client

client

database

web server

web server

client

client